from django.shortcuts import render,HttpResponse
from .ana import ChipotleAna
# Create your views here.
REMOTE_HOST = "https://pyecharts.github.io/assets/js"
def index(request):

    chipo =ChipotleAna()
    bar= chipo.bar_how_many_sold_per_item()
    # bar= chipo.echarts_bar(info.index,info.quantity)

    context = dict(
        myechart=bar.render_embed(),
        host = REMOTE_HOST,
        script_list=bar.get_js_dependencies()
    )

    return render(request,'exData/index.html',context)

def index2(request):
    chipo=ChipotleAna()
    bar=chipo.bar_how_much_sold_per_item()
    context=dict(
        myechart=bar.render_embed(),
        host=REMOTE_HOST,
        script_list=bar.get_js_dependencies()
    )
    return render(request, 'exData/index.html', context)

def hhhh(request):
    return render(request,'exData/home.html')